From: Glenn Morris Date: Tue, 12 Oct 2010 07:44:12 +0000 (-0700) Subject: * make-dist: Simplify trap handling. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~6114 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=bc465d2b4a2b04867a835b9934c5d565f7bda054;p=emacs.git * make-dist: Simplify trap handling. --- diff --git a/make-dist b/make-dist index 6da5502a3d8..12784060a0d 100755 --- a/make-dist +++ b/make-dist @@ -299,7 +299,7 @@ tempdir="${tempparent}/${emacsname}" ### This trap ensures that the staging directory will be cleaned up even ### when the script is interrupted in mid-career. if [ "${clean_up}" = yes ]; then - trap "echo 'Interrupted...cleaning up the staging directory'; rm -rf ${tempparent}; exit 1" 1 2 15 + trap "echo 'Cleaning up the staging directory'; rm -rf ${tempparent}" EXIT fi echo "Creating top directory: \`${tempdir}'" @@ -571,10 +571,7 @@ if [ "${make_tar}" = yes ]; then > ${emacsname}.tar${gzip_extension} fi -if [ "${clean_up}" = yes ]; then - echo "Cleaning up the staging directory" - rm -rf ${tempparent} -else +if [ "${clean_up}" != yes ]; then (cd ${tempparent}; mv ${emacsname} ..) rm -rf ${tempparent} fi